﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CarShopManagerBLL;

namespace CarShopManagerWeb
{
    public partial class Index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindCarOrderList();
            }
        }

        public void BindCarOrderList()
        {
            string carName=txtCarName.Text.Trim();
            int carType=Convert.ToInt32(DDLCarType.SelectedValue);
            GDVCarOrderList.DataSource = CarInfoBLL.GetCarOrderList(carName, carType);
            GDVCarOrderList.DataBind();
        }
       
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            BindCarOrderList();
        }

        protected void LinkButton1_Command(object sender, CommandEventArgs e)
        {
            Response.Redirect("Order.aspx?id=" + e.CommandArgument);
        }
    }
}